home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / rjs.lha / RJS / Transport / tests / dserver_fork.C < prev    next >
C/C++ Source or Header  |  1991-06-14  |  400b  |  24 lines

  1. #include <iostream.h>
  2. #include <stdio.h>
  3. #include <osfcn.h>
  4. #include <libc.h>
  5.  
  6. #include "RJS/Transport.h"
  7.  
  8. int main(int argc, char *argv[]) 
  9. {
  10. DECnetSocket server(140),client;
  11.  
  12.  
  13.  
  14.  server.accept(client);                // accept a client
  15.  
  16.  if (fork()==0) {                 // child
  17.      server.close();                 // don't need this anymore!
  18.      client.linger();
  19.      client.write("hello",6);            // write to client
  20.  }
  21.  
  22.  exit(0);
  23. }
  24.